''' 迭代器 边用边取 '''

# L = [1,2,3,4]

# 返回一个迭代器对象
# it = iter(L)

# while True:
#     try:
#         print(next(it))
#     except StopIteration:
#         break


s = {'江江','丽丽','嬷嬷','花花','红红'}

# 方式一
it = iter(s)

while True:
    try:
        print(next(it))
    except StopIteration:
        break


print("-----------------------")

# 方式二
for i in s:
    print(i)

print('-----------------------')

# 方式三
print({i for i in s})



